<?php

class Ialbum_Widget_RecentPhotosController extends Engine_Content_Widget_Abstract
{
  public function indexAction()
  {
  	$recentType = $this->_getParam('recentType', 'creation_date');
	$this->view->paginator = $paginator =  Engine_Api::_()->getApi('photo', 'ialbum')->getPhotoPaginator(array('order'=> $recentType .' DESC'));
    $paginator->setItemCountPerPage($this->_getParam('itemCountPerPage', 12));
    $paginator->setCurrentPageNumber($this->_getParam('page', 1));
	if ($paginator->getTotalItemCount() <= 0) return $this->setNoRender();
  }
}